
using System;
using System.Configuration;
namespace Reverso
{


	public partial class Configuracao : Gtk.Window
	{
		protected virtual void OnBtnSalvarClicked (object sender, System.EventArgs e)
		{
			System.Configuration.Configuration config =
         ConfigurationManager.OpenExeConfiguration
                    (ConfigurationUserLevel.None);

			 config.AppSettings.Settings.Add("Host",txtHost.Text);
			 config.AppSettings.Settings.Add("Porta",txtPorta.Text);
			config.AppSettings.Settings.Add("SID",txtSID.Text);
			config.AppSettings.Settings.Add("Usuario",txtUsuario.Text);
			config.AppSettings.Settings.Add("Senha",txtSenha.Text);
			
			
			config.Save();
			this.Destroy();
			
		}
		
		

		public Configuracao () : base(Gtk.WindowType.Toplevel)
		{
			this.Build ();
			
			System.Configuration.Configuration config =
         ConfigurationManager.OpenExeConfiguration
                    (ConfigurationUserLevel.None);
			
			txtHost.Text = config.AppSettings.Settings["Host"].Value;
			txtPorta.Text = config.AppSettings.Settings["Porta"].Value;
			txtSID.Text = config.AppSettings.Settings["SID"].Value;
			txtUsuario.Text = config.AppSettings.Settings["Usuario"].Value;
			txtSenha.Text = config.AppSettings.Settings["Senha"].Value;
			
			
		}
	}
}
